/*  1:   */ package org.jetbrains.generate.tostring.element;
/*  2:   */ 
/*  3:   */ import java.util.Comparator;
/*  4:   */ 
/*  5:   */ public class ElementComparator
/*  6:   */   implements Comparator<Element>
/*  7:   */ {
/*  8:   */   private final int a;
/*  9:   */   
/* 10:   */   public ElementComparator(int paramInt)
/* 11:   */   {
/* 12:33 */     this.a = paramInt;
/* 13:   */   }
/* 14:   */   
/* 15:   */   public int compare(Element paramElement1, Element paramElement2)
/* 16:   */   {
/* 17:37 */     if (this.a == 0) {
/* 18:38 */       return 0;
/* 19:   */     }
/* 20:41 */     String str1 = a(paramElement1);
/* 21:42 */     String str2 = a(paramElement2);
/* 22:   */     
/* 23:44 */     int i = str1.compareToIgnoreCase(str2);
/* 24:45 */     if (this.a == 2) {
/* 25:46 */       i = -1 * i;
/* 26:   */     }
/* 27:49 */     return i;
/* 28:   */   }
/* 29:   */   
/* 30:   */   private static String a(Element paramElement)
/* 31:   */   {
/* 32:61 */     String str = paramElement.getName();
/* 33:62 */     if (str.startsWith("_")) {
/* 34:63 */       return str.substring(1);
/* 35:   */     }
/* 36:65 */     return str;
/* 37:   */   }
/* 38:   */ }


/* Location:           E:\idea\
 * Qualified Name:     org.jetbrains.generate.tostring.element.ElementComparator
 * JD-Core Version:    0.7.0.1
 */